package com.busi.wms.model;

import java.util.Map;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;
import com.zcurd.common.tool.DbMetaTool;

public class WmsStock extends Model<WmsStock> {
	private static final long serialVersionUID = 1L;
	public static final WmsStock me = new WmsStock();
		
	public Map<String, Object> getDictDatapd_type() {
		return DbMetaTool.getDictData("select '1' 'key', '月计划' 'text' union all select '2', '不定期'");
	}	
		
	public Map<String, Object> getDictDatastorage_no() {
		return DbMetaTool.getDictData("select cast(id as varchar) 'key',storage_name 'text' from [cquni-wms].dbo.wms_storage");
	}

	public  Map<String, Object> getDictDatapd_status() {
		return DbMetaTool.getDictData("select 'false' 'key', '未开始' 'text' union all select 'true', '已完成'");
	}

	public int getStorageIdByname(String para) {
		// TODO Auto-generated method stub
		return Db.queryInt("select id from wms_storage where storage_name=?",para);
	}	
	
}
